def sum_of_digits(n):
    sum = 0
    while n > 0:
        sum += n % 10
        n //= 10
    return sum

input_num = input("请输入一个正整数或小数：")
if "." in input_num:
    print(".")
else:
    n = int(input_num)
    print("各位之和为：", sum_of_digits(n))